package cn.tedu.validationdemo.entity;


import cn.tedu.validationdemo.RegExpressions;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

public class User implements RegExpressions {

    @NotNull(message = "登录错误,必须提交用户名")
    @Pattern(regexp = REGEXP_USERNAME,
            message = MESSAGE_USERNAME_LOGIN)
    private String username;
    private String password;

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
